@use '../mixins/mixins';
@use '../common/var';
@use '../common/transition';

@include mixins.b(date-editor) {
	position: relative;
	display: inline-block;
	text-align: left;

	&.el-input,
	&.el-input__inner {
		width: 100%;
	}

	@include mixins.m((monthrange)) {
		&.el-input,
		&.el-input__inner {
			width: 300px;
		}
	}

	@include mixins.m((daterange, timerange)) {
		&.el-input,
		&.el-input__inner {
			width: 350px;
		}
	}

	@include mixins.m(datetimerange) {
		&.el-input,
		&.el-input__inner {
			width: 400px;
		}
	}

	@include mixins.m(dates) {
		.el-input__inner {
			text-overflow: ellipsis;
			white-space: nowrap;
		}
	}

	.el-icon-circle-close {
		cursor: pointer;
	}

	.el-range__icon {
		font-size: 14px;
		margin-left: -5px;
		color: var(--color--text--tint-2);
		float: left;
		line-height: 32px;
	}

	.el-range-input {
		appearance: none;
		border: none;
		outline: none;
		display: inline-block;
		height: 100%;
		margin: 0;
		padding: 0;
		width: 39%;
		text-align: center;
		font-size: var.$font-size-base;
		color: var(--color--text--shade-1);

		&::placeholder {
			color: var(--color--text--tint-2);
		}
	}

	.el-range-separator {
		display: inline-block;
		height: 100%;
		padding: 0 5px;
		margin: 0;
		text-align: center;
		line-height: 32px;
		font-size: 14px;
		width: 5%;
		color: var(--color--text--shade-1);
	}

	.el-range__close-icon {
		font-size: 14px;
		color: var(--color--text--tint-2);
		width: 25px;
		display: inline-block;
		float: right;
		line-height: 32px;
	}
}

@include mixins.b(range-editor) {
	&.el-input__inner {
		display: inline-flex;
		align-items: center;
		padding: 3px 10px;
	}

	.el-range-input {
		line-height: 1;
	}

	@include mixins.when(active) {
		border-color: var(--color--primary);

		&:hover {
			border-color: var(--color--primary);
		}
	}

	@include mixins.m(medium) {
		&.el-input__inner {
			height: var.$input-medium-height;
		}

		.el-range-separator {
			line-height: 28px;
			font-size: var.$input-medium-font-size;
		}

		.el-range-input {
			font-size: var.$input-medium-font-size;
		}

		.el-range__icon,
		.el-range__close-icon {
			line-height: 28px;
		}
	}

	@include mixins.m(small) {
		&.el-input__inner {
			height: var.$input-small-height;
		}

		.el-range-separator {
			line-height: 24px;
			font-size: var.$input-small-font-size;
		}

		.el-range-input {
			font-size: var.$input-small-font-size;
		}

		.el-range__icon,
		.el-range__close-icon {
			line-height: 24px;
		}
	}

	@include mixins.m(mini) {
		&.el-input__inner {
			height: var.$input-mini-height;
		}

		.el-range-separator {
			line-height: 20px;
			font-size: var.$input-mini-font-size;
		}

		.el-range-input {
			font-size: var.$input-mini-font-size;
		}

		.el-range__icon,
		.el-range__close-icon {
			line-height: 20px;
		}
	}

	@include mixins.when(disabled) {
		background-color: var.$input-disabled-fill;
		border-color: var.$input-disabled-border;
		color: var.$input-disabled-color;
		cursor: not-allowed;

		&:hover,
		&:focus {
			border-color: var.$input-disabled-border;
		}

		input {
			background-color: var.$input-disabled-fill;
			color: var.$input-disabled-color;
			cursor: not-allowed;
			&::placeholder {
				color: var.$input-disabled-placeholder-color;
			}
		}

		.el-range-separator {
			color: var.$input-disabled-color;
		}
	}
}
